package com.hele.sts.dao;

import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;

import com.hele.sts.pub.ConnectDB;
import com.hele.sts.pub.SpringContextHolder;

public class BMGxdwDao
{
  static String TABLE = "bm_gxdw";
  
  public static String getGxdw(String gxdw)
  {
    Connection conn = null;
    PreparedStatement pstmt = null;
    ResultSet rs = null;
    String sql = null;
    ConnectDB connsyb = null;
    String content = null;
    sql = "SELECT content FROM " + TABLE + " WHERE code = '" + gxdw + "' ";
    try
    {
      connsyb = SpringContextHolder.getBean(ConnectDB.class);
      conn = connsyb.getConnection();
      pstmt = conn.prepareStatement(sql);
      rs = pstmt.executeQuery();
      if (rs.next())
      {
        content = rs.getString("content");
        String str1 = content;return str1;
      }else {
    	  content="未知";
      }
    }
    catch (SQLException localSQLException) {}finally
    {
      DbClose.freePreparedStatement(pstmt);
      DbClose.freeConnection(conn);
      DbClose.freeResultSet(rs);
      System.out.println(content);
    }
    return null;
  }
}
